<!DOCTYPE html>
<html>
<head>
	<title>Unloading accordion</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style>
		div#accObj {
			position: relative;
			width: 360px;
			height: 400px;
		}
		div.acc_shadow {
			box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.09);
		}
	</style>
	<script>
		var myAcc;
		var accObj;
		function initAcc() {
			if (myAcc == null) {
				if (accObj == null) accObj = document.getElementById("accObj");
				if (accObj.className.match(/acc_shadow/) == null) accObj.className += " acc_shadow";
				myAcc = new dhtmlXAccordion(accObj);
				myAcc.loadStruct("../common/acc.json");
			}
		}
		function unloadAcc() {
			if (myAcc != null) {
				myAcc.unload();
				myAcc = null;
				accObj.className = accObj.className.replace(/\s*acc_shadow/gi, "");
			}
		}
	</script>
</head>
<body onload="initAcc();">
	<div id="accObj"></div>
	<input type="button" value="init" onclick="initAcc();" style="margin-top:20px;">
	<input type="button" value="unload" onclick="unloadAcc();" style="margin-top:20px;">
</body>
</html>